Skip to content

fix(s2s): dispatch on the transcription model names the config uses - #873

Merged
maciejmajek merged 1 commit into
mainfrom
fix/asr-from-config-model-names
Sep 8, 2026
Merged

fix(s2s): dispatch on the transcription model names the config uses#873
maciejmajek merged 1 commit into
mainfrom
fix/asr-from-config-model-names

Conversation

@maciejmajek

Copy link
Copy Markdown
Member

Purpose

  • SpeechRecognitionAgent.from_config cannot load any valid config. It raises for every accepted value of transcription_model.

Proposed Changes

  • The match arms in asr_agent.py expected "LocalWhisper (Free)", "FasterWhisper (Free)" and "OpenAI (Cloud)", while TRANSCRIBE_MODELS, the shipped config.toml and the configurator all use the bare names. Anything valid fell through to case _ and raised. Now matches the bare names, with the error message naming model_type and the valid options instead of model_name (and without the stray f inside the string).
  • Gave the VAD match a default arm. It had none, so an unrecognised vad_model left vad unbound and came out as an UnboundLocalError at construction.
  • rai_s2s 1.0.2.

Issues

Testing

  • tests/s2s/test_asr_agent_from_config.py walks TRANSCRIBE_MODELS and asserts every advertised value reaches a model, with the models and the agent constructor stubbed so nothing is downloaded or opens a device. Also covers the old suffixed spelling and an unknown vad_model.
  • pytest tests/s2s tests/communication/sounds_device: 37 passed.

SpeechRecognitionAgent.from_config matched on "LocalWhisper (Free)",
"FasterWhisper (Free)" and "OpenAI (Cloud)", but TRANSCRIBE_MODELS, the
shipped config.toml and the Streamlit configurator all use the bare names.
Every valid config fell through to the default arm and raised, so
from_config could not load any of the three models.

Also gives the VAD match a default arm. It had none, so an unrecognised
vad_model left vad unbound and surfaced as an UnboundLocalError.
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.41%. Comparing base (e565d31) to head (861d964).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #873   +/-   ##
=======================================
  Coverage   74.41%   74.41%           
=======================================
  Files          82       82           
  Lines        3627     3627           
=======================================
  Hits         2699     2699           
  Misses        928      928           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@maciejmajek
maciejmajek merged commit 741469d into main Sep 8, 2026
10 checks passed
@maciejmajek
maciejmajek deleted the fix/asr-from-config-model-names branch September 8, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants